<HTML><HEAD><TITLE>library(cprolog)</TITLE></HEAD><BODY>
[ <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]<H1>library(cprolog)</H1>
C-Prolog compatibility package
<H2>Predicates</H2>
<BLOCKQUOTE>
<DL>
<DT><STRONG>.(?, ?, ?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>abolish(?, ?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>consult(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>current_functor(?, ?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>current_predicate(?, ?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>db_reference(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>erased(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>fileerrors</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>get(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>get0(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>heapused(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>instance(?, ?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>leash(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>log(?, ?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>log10(?, ?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>nofileerrors</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>primitive(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>prompt(?, ?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>put(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>reconsult(?)</STRONG></DT>
<DD>No description available</DD>
<DT><STRONG>sh</STRONG></DT>
<DD>No description available</DD>
</DL>
</BLOCKQUOTE>
<H2>Reexports</H2>
<BLOCKQUOTE><DL>
<DT><STRONG>reexport <A HREF="../../lib/cio/index.html">cio</A></STRONG></DT><DD></DD>
<DT><STRONG>reexport eclipse_language</STRONG></DT><DD>except get / 1, put / 1, instance / 2, abolish / 1, macro(if / 2, _, _)</DD>
</DL></BLOCKQUOTE>
<H2>Other Exports</H2>
<BLOCKQUOTE><DL>
<DT><STRONG>export op(0, xfx, of)</STRONG></DT><DD></DD>
<DT><STRONG>export op(0, xfx, with)</STRONG></DT><DD></DD>
<DT><STRONG>export op(0, xfy, do)</STRONG></DT><DD></DD>
<DT><STRONG>export op(0, xfx, @)</STRONG></DT><DD></DD>
<DT><STRONG>export op(0, fx, -?->)</STRONG></DT><DD></DD>
<DT><STRONG>export macro(with / 2, = / 2, [])</STRONG></DT><DD></DD>
<DT><STRONG>export macro(of / 2, = / 2, [])</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(nl_in_quotes)</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(no_blanks)</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(no_array_subscripts)</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(limit_arg_precedence)</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(doubled_quote_is_quote)</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(bar_is_no_atom)</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(no_attributes)</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(no_curly_arguments)</STRONG></DT><DD></DD>
<DT><STRONG>export syntax_option(blanks_after_sign)</STRONG></DT><DD></DD>
<DT><STRONG>export chtab(36, lower_case)</STRONG></DT><DD></DD>
<DT><STRONG>export chtab(92, symbol)</STRONG></DT><DD></DD>
<DT><STRONG>export chtab(128, string_quote)</STRONG></DT><DD></DD>
<DT><STRONG>export chtab(34, list_quote)</STRONG></DT><DD></DD>
<DT><STRONG>export op(300, xfx, mod)</STRONG></DT><DD></DD>
<DT><STRONG>export op(500, fx, +)</STRONG></DT><DD></DD>
<DT><STRONG>export op(500, fx, -)</STRONG></DT><DD></DD>
<DT><STRONG>export op(900, fy, spy)</STRONG></DT><DD></DD>
<DT><STRONG>export op(900, fy, nospy)</STRONG></DT><DD></DD>
</DL></BLOCKQUOTE>
<H2>Description</H2>

    One of the requirements during the development of ECLiPSe has been the
    aim of minimising the work required to port traditional Prolog
    programs to ECLiPSe.  A de-facto standard for many years was the
    C-Prolog dialect, often referred to as Edinburgh Prolog.  Therefore,
    many of the non standard predicates in C-Prolog have also been
    included in ECLiPSe.  It is of course impossible to achieve total
    compatibility between the two systems.  To assist in making the
    changes necessary to run a C-Prolog program on the current version of
    ECLiPSe, we describve here the predicates available in the
    C-Prolog compatibility library and summarise the principal
    differences between ECLiPSe Prolog and C-Prolog. 
    <P>
    Most of the C-Prolog predicates are also ECLiPSe built-in predicates
    and so they can be always accessed. 
    <P>
    Please note that this text does not detail the functionality of
    C-Prolog, refer to the C-Prolog documentation for this information. 
    <P>
    The effect of the compatibility library is local to the module where
    it is loaded. For maximum compatibility, a C-Prolog program should
    be wrapped in a separate module starting with a directive like
    <PRE>
    :- module(mymodule, [], cprolog).
    </PRE>
    In this case, Eclipse-specific language constructs will not be available.
    <P>
    If the compatibility package is loaded into a standard module, e.g. like
    <PRE>
    :- module(mymixedmdule).
    :- use_module(library(cprolog)).
    </PRE>
    then C-Prolog and Eclipse language features can be used together. 
    However, ambiguities must be resolved explicitly and confusion may
    arise from the different meaning of quotes in Eclipse vs C-Prolog.
    <P>
    Note that the C-Prolog compatibility package includes the <EM>cio</EM>
    library (for see/1, seeing/1, seen/0, skip/1, tab/1, tell/1, telling/1,
    told/0).
    <P>
    The following C-Prolog predicates are not available in ECLiPSe, or
    the corresponding predicates have a different semantics: 
    <DL>
    <DT>assert/2, asserta/2, assertz/2, clause/3 
	<DD>ECLiPSe does not support database references for clauses. 
    <DT>expand_term/2 
	<DD>This is not supported.  ECLiPSe provides the macro facility
	    for transforming input terms (see chapter 13). 
    <DT>&#39;LC&#39;/0, &#39;NOLC&#39;/0 
	<DD>These are not supported in ECLiPSe. 
    </DL>
    <P>
    The following differences remain even with the compatibility package: 
    <DL>
    <DT>Database References 
	<DD>ECLiPSe provides database references only for terms in the indexed database, not for program clauses. 
    <DT>Numbers 
	<DD>C-Prolog has a tendency to "prefer" integers over real
	numbers.  For instance, under C-Prolog when the call X is
	4.0/2.0 is made, X is instantiated to an integer.  This
	behaviour does not occur in ECLiPSe.  The order of integers
	and reals in the standard order is different. 
    <DT>Operators 
	<DD>In C-Prolog there is a bug regarding the operator not -- it
	binds closer than its precedence declaration. 
    <DT>Strings 
	<DD>Strings are simulated in C-Prolog by lists.  Under C-Prolog
	mode, ECLiPSe provides this functionality -- double-quoted
	strings are parsed as lists of integers.  This can cause
	confusion when pure ECLiPSe predicates are used in C-Prolog
	mode, e.g.  substring/3 will not accept double-quoted items,
	since they are lists, not ECLiPSe strings.  The built-in
	string_list/2 converts between both representations. 
    <DT>consult/1, reconsult/1 
	<DD>These are implemented by simply calling the ECLiPSe predicate
	compile/1.  By default all compiled procedures are static. 
	Procedures on which assert/1 etc.  will be applied, have to be
	declared as dynamic using dynamic/1.  The notation [-File] for
	reconsult/1 is not supported. 
    <DT>get/1
	<DD>This is similar to the ECLiPSe predicate get/1, but
	control characters and blank spaces are skipped. 
    <DT>put/1
	<DD>This is similar to the ECLiPSe predicate put/1, but it
	first applies arithmetic evaluation to its argument. 
    <DT>heapused/1
	<DD>Needed for evaluating heapused in arithmetic expressions. 
	It returns the sum of code heap and general heap usage. 
    <DT>instance/2
	<DD>Note that this compatibility predicate redefines the
	ECLiPSe builtin of the same name but different meaning (which
	is no longer available in C-Prolog mode).  It is implemented
	using the ECLiPSe predicate referenced_record/2. 
    <DT>log/2, log10/2
	<DD>These are not predicates in C-Prolog (arithmetic
	functors), but in ECLiPSe they are needed for evaluating log/1
	and log10/1 in arithmetic expressions. 
    <DT>ttyput/1
    	<DD>corresponds to the DEC-10 Prolog predicate 
    </DL>
    The list below describes the syntax differences between ECLiPSe
    and C-Prolog.  The following C-Prolog properties are simulated by
    the compatibility package: 
    <UL>
	<LI>single (resp. double) quote must be doubled between single (resp. double) quotes. 
	<LI>$ is a normal character. 
	<LI>the symbol | is not an atom. 
    </UL>
    The following properties of original C-Prolog are not simulated by
    the compatibility package: 
    <UL>
	<LI>a clause can not be ended by end of file. 
	<LI>based integers are not accepted. 
	<LI>comments are not a delimiter (just ignored). 
	<LI>{} is not an atom. 
	<LI>[] can not be a functor. 
    </UL>
    
<H2>About</H2><UL COMPACT>
<LI><STRONG>Author: </STRONG>Various, ECRC Munich
<LI><STRONG>Copyright &copy; </STRONG>Cisco Systems, Inc
<LI><STRONG>Date: </STRONG>$Date: 2009/02/19 05:38:37 $
</UL>
<H2>See Also</H2>
<A HREF="../../lib/cio/index.html">library(cio)</A>, <A HREF="../../lib/quintus/index.html">library(quintus)</A><HR>Generated from cprolog.eci on 2009-05-27 01:25
</BODY></HTML>
